package cn.kgc.mushroomdatabaseprovider.commoditycontroller;

import cn.kgc.mushroomcommon.pojo.Commodity;
import cn.kgc.mushroomcommon.pojo.ResultEntity;
import cn.kgc.mushroomcommon.pojo.User;
import cn.kgc.mushroomdatabaseprovider.service.CommodityService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/database/provider/commodity")
@RestController
public class CommodityController {
    @Resource
    CommodityService commodityService;
    @RequestMapping("/selectCommodityAndDetail")
    public Commodity selectCommodityAndDetail(@RequestParam("id") Integer id) {
        return commodityService.selectCommodityAndDetail(id);
    }

    @RequestMapping("/selectshopallname")
    public List<Commodity> selectshopallname(@RequestParam("tid")Integer tid){
         List<Commodity> commodities = commodityService.selectShopAllByName(tid);
         return commodities;
    }
}
